﻿///    /************************************************************************ 
///     * uoLib library for .Net projects.
///     * Copyright (c) 2009 by uonun
///     * Homepage: http://uolib.ourome.com
///     * 
///     * This program is free software: you can redistribute it and/or modify
///     * it under the terms of the GNU General Public License as published by
///     * the Free Software Foundation, either version 3 of the License, or
///     * (at your option) any later version.

///     * This program is distributed in the hope that it will be useful,
///     * but WITHOUT ANY WARRANTY; without even the implied warranty of
///     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
///     * GNU General Public License for more details.

///     * You should have received a copy of the GNU General Public License
///     * along with this program.  If not, see http://www.gnu.org/licenses/gpl.html.
///     ***********************************************************************/ 

using System;
using System.Collections.Generic;
using System.Text;

namespace uoLib
{
    [AttributeUsage(AttributeTargets.All, AllowMultiple = true)]
     class HelpAttribute : System.Attribute
    {
        private string _url;

        public string Url
        {
            get { return _url; }
        }
        public HelpAttribute(string url)
        {
            _url = url;
        }
    }

    [AttributeUsage(AttributeTargets.All, AllowMultiple = true)]
     class AuthorAttribute : System.Attribute
    {
        private string _author;
        private string _email;
        private string _homePage;

        public string Author
        {
            get { return _author; }
        }
        public string Email
        {
            get { return _email; }
            set { _email = value; }
        }
        public string HomePage
        {
            get { return _homePage; }
            set { _homePage = value; }
        }

        public AuthorAttribute(string author)
        {
            _author = author;
        }
    }

    /// <summary>
    /// 标识此模块的适用范围
    /// </summary>
    /// <remarks>
    /// 这些标识用于大致上区分类、方法、属性等模块适用的项目类型。
    /// 比如<see cref="uoLib.Functions.ReportMsg"/>方法中使用了<see cref="AvailableTypeAttribute.Type.WebForm"/>所特有的<see cref="System.Web.HttpResponse.Write"/>方法，显然这个方法无法在 <see cref="AvailableTypeAttribute.Type.WinForm"/> 中正常执行，
    /// 因此<see cref="uoLib.Functions.ReportMsg"/>被标识为<see cref="AvailableTypeAttribute.Type.WebForm"/>的特有方法。
    /// </remarks>
    [AttributeUsage(AttributeTargets.All, AllowMultiple = true)]
    public class AvailableTypeAttribute : System.Attribute
    {
        private Type _type;

        public AvailableTypeAttribute(Type type) {
            _type = type;
        }

        public enum Type
        {
            /// <summary>
            /// 任意
            /// </summary>
            Any,
            /// <summary>
            /// 应使用于C/S架构的WinForm项目中。
            /// </summary>
            WinForm,
            /// <summary>
            /// 应使用于B/S架构的WebForm项目中。
            /// </summary>
            WebForm
        }
    }
}
